package ynu.lcy.service;

import org.springframework.transaction.annotation.Transactional;
import ynu.lcy.dto.business.BusinessQueryDTO;
import ynu.lcy.dto.business.BusinessRequestDTO;
import ynu.lcy.entity.Business;

import java.util.List;

/**
 * 商家服务
 * @author 梁超映
 * */
public interface BusinessService {
    /**
     * 根据权重进行推荐
     * @return
     * */
    public List<Business> listByWeight();

    /**
     * 根据关键字查询
     * @param dto
     * @return
     * */
    public List<Business> listByKeyword(BusinessQueryDTO dto);

    /**
     * 根据类型商家
     * @param typeId
     * @return
     * */
    @Transactional
    public List<Business> listByType(Long typeId);

    /**
     * 根据id获取信息
     * @param id
     * @return
     * */
    public Business getById(Long id);

    /**
     * 添加商家
     * @param dto
     * @return
     * */
    @Transactional
    public Business add(BusinessRequestDTO dto);
}
